//
//  UIColor+XDHex.m
//  kabu
//
//  Created by XiangDongMBP on 2017/1/17.
//  Copyright © 2017年 East. All rights reserved.
//

#import "UIColor+XDHex.h"

@implementation UIColor (XDHex)

+ (UIColor *)xd_colorWithHex:(NSUInteger)hex {
    return [self xd_colorWithHex:hex alpha:1.0];
}

+ (UIColor *)xd_colorWithHex:(NSUInteger)hex alpha:(CGFloat)alpha {
    return [UIColor colorWithRed:((float)((hex & 0xFF0000) >> 16)) / 255.0
                           green:((float)((hex & 0x00FF00) >> 8)) / 255.0
                            blue:((float)(hex & 0x0000FF)) / 255.0
                           alpha:alpha];
}

@end
